From: Daniel Golle Date: Sat, 3 Jan 2026 21:05:35 +0000 (+0000) Subject: kernel: net: phy: c45: check validity of 10GbE LPA X-Git-Url: http://git.openwrt.org/%22http:/oss.oetiker.ch/rrdtool//%22/%22http:/oss.oetiker.ch/rrdtool/%22?a=commitdiff_plain;h=96ff31b94acc5da50fb3caeccfe6f4abdd7c903b;p=openwrt%2Fopenwrt.git kernel: net: phy: c45: check validity of 10GbE LPA Only use link-partner advertisement bits for 10GbE modes if they are actually valid. Check LOCALOK and REMOTEOK bits and clear 10GbE modes unless both of them are set. Signed-off-by: Daniel Golle --- diff --git a/target/linux/generic/pending-6.12/713-net-phy-c45-check-validity-of-10GbE-link-partner.patch b/target/linux/generic/pending-6.12/713-net-phy-c45-check-validity-of-10GbE-link-partner.patch new file mode 100644 index 0000000000..5870dfb2ba --- /dev/null +++ b/target/linux/generic/pending-6.12/713-net-phy-c45-check-validity-of-10GbE-link-partner.patch @@ -0,0 +1,29 @@ +From 7d719484930bc10c8472c0d43b94b68087541b24 Mon Sep 17 00:00:00 2001 +From: Daniel Golle +Date: Sat, 22 Apr 2023 01:25:39 +0100 +Subject: [PATCH] net: phy: c45: check validity of 10GbE link-partner + advertisement + +Only use link-partner advertisement bits for 10GbE modes if they are +actually valid. Check LOCALOK and REMOTEOK bits and clear 10GbE modes +unless both of them are set. + +Signed-off-by: Daniel Golle +--- a/include/linux/mdio.h ++++ b/include/linux/mdio.h +@@ -323,8 +323,14 @@ static inline u32 linkmode_adv_to_mii_10 + * to linkmode advertisement settings. Other bits in advertising aren't changed. + */ + static inline void mii_10gbt_stat_mod_linkmode_lpa_t(unsigned long *advertising, +- u32 lpa) ++ u32 lpa_in) + { ++ u32 lpa = lpa_in; ++ ++ if (!(lpa & MDIO_AN_10GBT_STAT_REMOK) || ++ !(lpa & MDIO_AN_10GBT_STAT_LOCOK)) ++ lpa = 0; ++ + linkmode_mod_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, + advertising, lpa & MDIO_AN_10GBT_STAT_LP2_5G); + linkmode_mod_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT,